//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.neurosky.thinkgear;

public class DistanceArray {
    public float[][] array;
    public int numRows = 0;
    public int numCols = 0;

    public DistanceArray() {
        this.array = new float[30][30];
    }

    public DistanceArray(int var1, int var2) {
        this.array = new float[var1][var2];
        this.numRows = var1;
        this.numCols = var2;
    }

    public float[] getRow(int var1) {
        float[] var2 = new float[this.numCols];

        for(int var3 = 0; var3 < this.numCols; ++var3) {
            var2[var3] = this.array[var1][var3];
        }

        return var2;
    }

    public DistanceArray subArray(int[] var1, int[] var2) {
        DistanceArray var3 = new DistanceArray(var1.length, var2.length);

        for(int var4 = 0; var4 < var1.length; ++var4) {
            for(int var5 = 0; var5 < var2.length; ++var5) {
                var3.array[var4][var5] = this.array[var1[var4]][var2[var5]];
            }
        }

        return var3;
    }

    public float mean() {
        float var1 = 0.0F;

        for(int var2 = 0; var2 < this.numRows; ++var2) {
            for(int var3 = 0; var3 < this.numCols; ++var3) {
                var1 += this.array[var2][var3];
            }
        }

        return var1 / (float)this.numRows / (float)this.numCols;
    }

    public float[] colMean() {
        float[] var1 = new float[this.numRows];

        for(int var2 = 0; var2 < this.numRows; ++var2) {
            for(int var3 = 0; var3 < this.numCols; ++var3) {
                var1[var2] += this.array[var2][var3] / (float)this.numCols;
            }
        }

        return var1;
    }
}
